// 传关键字，总数据
export function searchInfo(search, data) {
  console.log(search);
//   if(search === '未分配'){
//       search = null
//   }
  let reg = new RegExp(search.trim(), "i");
  let resArr = [];
  data.filter(item => {
    for (let i in item) {
      // console.log(item[i]);
      if (reg.test(item[i])) {
        resArr.push(item);
      }
    }
  });
  // 去重
  const res = new Map();
  data = resArr.filter(arr => {
    return !res.has(arr.id) && res.set(arr.id, 1);
  });
  console.log(data);
}
